<template>
  <div class="box">
    <div class="header">
      <van-nav-bar
        title="确认订单"
      
        left-arrow
        @click-left="$router.back()"
      />
    </div>
    <div class="content">
      <van-cell title="张三 15671689765" label="昌平区南口" is-link />
       
       <van-swipe-cell v-for="item in store.orderList" :key="item.id" class="active">
         
  <van-card
    :num="item.count"
    :price="item.price"
  
    :title="item.title"
  
    :thumb="item.image"
  />
   <van-row class="info active">
       <van-col span="12">商品金额：</van-col>
       <van-col>￥{{item.price}}</van-col>
   </van-row>
</van-swipe-cell>
<van-cell title="发票" is-link   value="请选择"  class="active"/>
       
        <div >
       <p class="price active" >应付金额:￥{{store.totalPrice}}</p>
      <van-button type="primary" @click="onSubmit" class="btn">支付宝支付</van-button>
      <van-button type="success" class="btn">微信支付</van-button>
  </div>
    </div>
  
  </div>
</template>

<script setup>
import request from '@/utils/request'
import { useCounterStore } from "@/stores/counter";
const store = useCounterStore();
import shake from '@/utils/shake'
const onSubmit= shake(()=>{
   //请求支付宝支付方式
   request.get('/pay').then(res=>{
    if(res.data.code==200)
    {
        window.location.href=res.data.data
    }
   })
},1000)

</script>

<style lang="scss" scoped>
.price{
    display: flex;
    justify-content: flex-end;
    color: red;
}
.btn{
    width: 100%;
    margin-top: 10px;
}
.info{
    background: #fff;
    padding: 10px;
    color: #888888;
}
.active{
    margin-top: 10px;
}
</style>